﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DMU
{
    class help
    {
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="kindOf"> -1:Infomation; 1:Error; 2:Question </param>
        /// <returns></returns>
        public DialogResult showMes(string message,int kindOf)
        {
            DialogResult dl;
            switch(kindOf)
            {
                case 1: 
                    dl=MessageBox.Show(message,"BK - Báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 2:
                    dl = MessageBox.Show(message,"BK - Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    break;
                default:
                    dl=MessageBox.Show(message, "BK - Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;

            }
            return dl;
        }

        public string openFile()
        {
            string s = "";
            OpenFileDialog op = new OpenFileDialog();
            op.Title = "Chọn file";
            op.Filter = "File excel|*.xlsx;*.xls";
            if (op.ShowDialog() == DialogResult.OK)
                s = op.FileName;
            return s;
        }

    }
}
